<div class="task-track-info">
  <div class="operation-header">
    <div>
      <span class="iconfont icon-return" ui-sref="menu.tasktrack.list"></span>
      <h3 ng-bind="vm.projectInfo.projectName"></h3>
      <span class="fallback-tip">(</span><span class="fallback-tip" ng-bind="vm.projectStatus[vm.projectInfo.status]"></span><span class="fallback-tip">...)</span>
      <br>
      <span class="header-info">预计时间：</span><span ng-bind="vm.projectInfo.dateText"></span>
      <span class="header-info"> 负责人：</span>
      <span ng-bind="vm.projectInfo.executor"></span>
    </div>
    <button class="button-default pull-right" ng-if="vm.projectInfo.status=='2'" onclick="$('#fallbackList').modal()">开始回退</button>
    <div class="pull-right" ng-if="vm.projectInfo.status!='3'&&vm.projectInfo.undoProjectTask=='0'" confirm-popup="vm.translateProjectStatus({changeId: ''}, 3)" confirm-title="'项目完成'" confirm-content="'项目完成就不可更改了，请确认是否继续？'">
      <button class="button-default button-checked" ng-if="vm.projectInfo.status=='2'">更新完成</button>
    </div>
    <div class="pull-right" ng-if="vm.projectInfo.status!='3'&&vm.projectInfo.undoProjectTask!='0'" confirm-popup="vm.translateProjectStatus({changeId: ''}, 3)" confirm-title="'项目完成'" confirm-content="'还有任务没完成，请确认是否继续？'">
      <button class="button-default button-checked" ng-if="vm.projectInfo.status=='2'">更新完成</button>
    </div>
    <div class="pull-right" ng-if="vm.projectInfo.status!='3'&&vm.projectInfo.undoFallbackTask=='0'" confirm-popup="vm.translateProjectStatus({changeId: ''}, 5)" confirm-title="'回退完成'" confirm-content="'回退完成就不可更改了，请确认是否继续？'">
      <button class="button-default button-checked" ng-if="vm.projectInfo.status=='4'">回退完成</button>
    </div>
    <div class="pull-right" ng-if="vm.projectInfo.status!='3'&&vm.projectInfo.undoFallbackTask!='0'" confirm-popup="vm.translateProjectStatus({changeId: ''}, 5)" confirm-title="'回退完成'" confirm-content="'还有任务没完成，请确认是否继续？'">
      <button class="button-default button-checked" ng-if="vm.projectInfo.status=='4'">回退完成</button>
    </div>
  </div>
  <div class="fallback" ng-if="vm.projectInfo.status=='4'||vm.projectInfo.status=='5'">
    <div class="operat-title">
      <div class="content">变更内容</div>
      <div class="execut">执行内容</div>
      <div class="time-spent">执行时间</div>
      <div class="executor">执行人</div>
      <div class="remark">备注</div>
    </div>
    <div class="fallback-operat-box" ng-class="{'fallback-gray-name':vm.projectInfo.status=='3'||vm.projectInfo.status=='5'}">
      <div class="operat-name">
        <div class="index">●</div>
        <i ng-show="vm.projectInfo.isFallbackOpen" ng-click="vm.projectInfo.isFallbackOpen=!vm.projectInfo.isFallbackOpen" class="iconfont icon-pull-down pointer"></i>
        <i ng-show="!vm.projectInfo.isFallbackOpen" ng-click="vm.projectInfo.isFallbackOpen=!vm.projectInfo.isFallbackOpen" class="iconfont icon-pull-up pointer"></i>
        <span ng-click="vm.projectInfo.isFallbackOpen=!vm.projectInfo.isFallbackOpen" class="pointer">回滚方案</span>
      </div>
    </div>
    <div class="operat" ng-repeat="operat in vm.projectInfo.fallbackList track by $index" ng-class="{'operat-gray-color':vm.projectInfo.status=='3'||vm.projectInfo.status=='5'}">
      <div class="operat-list" ng-class="{'list-close':!vm.projectInfo.isFallbackOpen}">
        <div class="list-name">
          <span class="index-dot"></span><span title="{{operat.fallbackName}}" class="operat-name" ng-bind="operat.fallbackName"></span>
          <div class="operation pull-right">
            <span ng-bind="operat.startTime | date:'HH:mm'"></span>
            <div class="time-line" ng-if="operat.startTime"></div>
            <span class="time-line-text" ng-if="operat.startTime&&!operat.endTime">执行中</span>
            <span ng-bind="operat.endTime | date:'HH:mm'"></span>
            <div class="operation-btn" ng-if="!operat.startTime"  confirm-popup="vm.translateFallbackStatus(operat, 1)" enabled="{{vm.projectInfo.status=='4'}}" confirm-title="'开始任务'" confirm-content="'任务开始后就不可取消了，请确认是否继续？'">
              <button class="button-default">开始</button>
            </div>
            <div class="operation-btn" ng-if="operat.startTime&&!operat.endTime" confirm-popup="vm.translateFallbackStatus(operat, 0)" enabled="{{vm.projectInfo.status=='4'}}" confirm-title="'结束任务'" confirm-content="'任务结束后就不可更改了，请确认是否继续？'">
              <button class="button-default">结束</button>
            </div>
          </div>
        </div>
        <div class="list-detail">
          <div class="border">
            <div class="content"><span class="cell-text" title="{{operat.content}}" ng-bind="operat.content"></span></div>
            <div class="time-spent"><span class="cell-text" title="{{operat.timeSpent}}" ng-bind="operat.timeSpent"></span></div>
            <div class="executor"><span class="cell-text" title="{{operat.executor}}" ng-bind="operat.executor"></span></div>
            <div class="remark"><span class="cell-text" title="{{operat.remark}}" ng-bind="operat.remark"></span><span ng-if="!operat.remark" class="cell-text">无</span></div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="change" ng-class="{'change-hide':!vm.projectInfo.isChangeOpen}">
    <div class="operat-title" ng-if="vm.projectInfo.status=='4'||vm.projectInfo.status=='5'">
      <div class="toggle-icon pointer" ng-click="vm.projectInfo.isChangeOpen=!vm.projectInfo.isChangeOpen">
        <i ng-show="vm.projectInfo.isChangeOpen" class="iconfont icon-triangledown"></i>
        <i ng-show="!vm.projectInfo.isChangeOpen" class="iconfont icon-triangleup"></i>
      </div>
      <div class="toggle-title pointer" ng-click="vm.projectInfo.isChangeOpen=!vm.projectInfo.isChangeOpen">项目更新方案</div>
    </div>
    <div class="operat-title">
      <div class="content">执行内容</div>
      <div class="time-spent">执行时间</div>
      <div class="account">从账号</div>
      <div class="permission-type">权限类型</div>
      <div class="url">IP/URL地址</div>
      <div class="executor">执行人</div>
      <div class="resource">变更资源</div>
      <div class="remark">备注</div>
    </div>
    <div class="operat" ng-repeat="(no, changeList) in vm.projectInfo.changeGroup track by $index" ng-class="{'change-operat-close':!vm.projectInfo.changeOpenStatus[$index],'operat-gray-color':vm.projectInfo.status=='3'||vm.projectInfo.status=='4'||vm.projectInfo.status=='5'}">
      <div class="operat-name">
        <div class="index" ng-bind="no"></div>
        <i ng-show="vm.projectInfo.changeOpenStatus[$index]" ng-click="vm.projectInfo.changeOpenStatus[$index]=!vm.projectInfo.changeOpenStatus[$index]" class="iconfont icon-pull-down pointer"></i>
        <i ng-show="!vm.projectInfo.changeOpenStatus[$index]" ng-click="vm.projectInfo.changeOpenStatus[$index]=!vm.projectInfo.changeOpenStatus[$index]" class="iconfont icon-pull-up pointer"></i>
        <span ng-bind="vm.projectInfo.noEnum[no]" ng-click="vm.projectInfo.changeOpenStatus[$index]=!vm.projectInfo.changeOpenStatus[$index]" class="pointer"></span>
      </div>
      <div class="operat-list" ng-repeat="step in changeList track by step.changeId">
        <div class="list-name">
          <span class="index-dot"></span><span ng-bind="step.expectStartTime | date:'HH:mm'"></span><span> 开始</span><span title="{{step.changeName}}" class="operat-name" ng-bind="step.changeName"></span>
          <div class="operation pull-right">
            <span ng-bind="step.startTime  | date:'HH:mm'"></span>
            <div class="time-line" ng-if="step.startTime"></div>
            <span class="time-line-text" ng-if="step.startTime&&!step.endTime">执行中</span>
            <span ng-bind="step.endTime | date:'HH:mm'"></span>
            <div class="operation-btn" ng-if="!step.startTime" confirm-popup="vm.translateChangeStatus(step, 1)" confirm-title="'开始任务'" enabled="{{vm.projectInfo.status=='1'||vm.projectInfo.status=='2'}}" confirm-content="'任务开始后就不可取消了，请确认是否继续？'">
              <button class="button-default">开始</button>
            </div>
            <div class="operation-btn" ng-if="step.startTime&&!step.endTime" confirm-popup="vm.translateChangeStatus(step, 0)" enabled="{{vm.projectInfo.status=='1'||vm.projectInfo.status=='2'}}" confirm-title="'结束任务'" confirm-content="'任务结束后就不可更改了，请确认是否继续？'">
              <button class="button-default">结束</button>
            </div>
          </div>
        </div>
        <div class="list-detail">
          <div class="border">
            <div class="content"><span class="cell-text" title="{{step.content}}" ng-bind="step.content"></span></div>
            <div class="time-spent"><span class="cell-text" title="{{step.timeSpent}}" ng-bind="step.timeSpent"></span></div>
            <div class="account"><span class="cell-text" title="{{step.account}}" ng-bind="step.account"></span></div>
            <div class="permission-type"><span class="cell-text" title="{{step.permissionType}}" ng-bind="step.permissionType"></span></div>
            <div class="url"><span class="cell-text" title="{{step.url}}" ng-bind="step.url"></span></div>
            <div class="executor"><span class="cell-text" title="{{step.executor}}" ng-bind="step.executor"></span></div>
            <div class="resource"><span class="cell-text" title="{{step.resource}}" ng-bind="step.resource"></span></div>
            <div class="remark"><span class="cell-text" title="{{step.remark}}" ng-bind="step.remark"></span><span ng-if="!step.remark" class="cell-text">无</span></div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="modal fade fallbakc-modal" id="fallbackList" tabindex="-1" role="dialog" data-backdrop="static">
    <div class="modal-dialog" role="document">
      <div class="modal-content modal-info">
        <div class="operator-title">
          <h4 class="modal-header">回退任务</h4>
          <div class="modal-close iconfont icon-close" data-dismiss="modal" aria-label="Close"></div>
          <div class="content-detail" ng-if="vm.changeList.length>0">
            <label>发生错误的任务</label>
            <div title="{{vm.currentTask.changeName}}">
              <select class="form-control" ng-model="vm.currentTask.changeId" ng-change="vm.getCurrentChangeName(vm.currentTask.changeId)">
                <option title="{{task.changeName}}" ng-value="task.changeId" ng-repeat="task in vm.changeList" ng-bind="task.changeName | subString:'30'"></option>
              </select>
            </div>
          </div>
        </div>
        <div class="line-bottom-btn text-center">
          <span class="bottom-line"></span>
          <div class="modal-button clearfix">
            <button aria-label="Close" ng-click="vm.translateProjectStatus(vm.currentTask, 4)">确定</button>
            <button data-dismiss="modal" aria-label="Close">取消</button>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>